#include "HufArc.h"
void intWrite (FILE * fileToWrite, unsigned long long int num, size_t size, unsigned int* ChkNum)
{
	char* buf;
	unsigned int i = 0;
	buf = (char *) realloc (NULL,sizeof(char)*size);
	if (!buf)
		cl_exit (INT_WRITE,MEMORY_ERR,fileToWrite);
	for (i = 0; i< size; i++)
	{
		if (i == 0) 
		{
			buf[i] =(num & 0xFF);
		} else {
		buf[i] =(unsigned char)( (num>>8*i) & 0xFF);
		}
	}
	strWrite (fileToWrite, buf,size,ChkNum);
	free(buf);
		//think about crc32!!!
}
